//
// Created by admin on 2024/10/27
// 素数筛

#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n=100; //25
    n=1000;//168
//    n=10000;//1229
//    n=100000;//9592
//    cin >> n;
    bool isp[n+1]={0};
    for (int i = 2; i <=n ; ++i)
        isp[i]=1;
    vector<int> primes;
    for (int i = 2; i <= n ; ++i)
    {
        if (isp[i])
            primes.push_back(i);
        for (int j = 0; j < primes.size() && i*primes[j]<=n; ++j)
        {
            isp[i*primes[j]]=0;
            if(i%primes[j]==0)
                break;
        }
    }
    cout<<primes.size();
    return 0;
}